package com.huaxin.hxmoduleworkorder.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.huaxin.hxmoduleworkorder.common.enums.InspectionTemplateStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;

@Data
@TableName("inspection_template")
@EqualsAndHashCode(callSuper = true)
public class InspectionTemplate extends BaseModel {
    @TableField(value = "code")
    @Schema(description = "模板编码", example = "MONTHLY_SAFETY")
    private String code;

    @TableField(value = "name")
    @Schema(description = "模板名称", example = "月度安全巡查")
    private String name;

    @TableField(value = "description")
    @Schema(description = "模板说明", example = "每月对客户进行一次全面电气安全检查")
    private String description;

    @TableField(value = "effective_from")
    @Schema(description = "生效日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate effectiveFrom;

    @TableField(value = "effective_to")
    @Schema(description = "失效日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate effectiveTo;

    @TableField(value = "status")
    @Schema(description = "状态：active/inactive", example = "active")
    private InspectionTemplateStatus status;
}

